/**
 * 
 */
package valfazz.android.karfinder.activity;

import valfazz.android.karfinder.R;
import valfazz.android.karfinder.util.SongUpdater;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

/**
 * 
 * @author LuChanThanh
 *
 */
public class HelpActivity extends Activity {
	TextView tvSearch;
	String prefixSymbol, strChuThich="" ;
	Button btnCheckUpdate;
	String[] prefixNote;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_help);
		btnCheckUpdate = (Button)findViewById(R.id.btnCheckUpdate);		
		tvSearch = (TextView)findViewById(R.id.tvSearch);
		prefixSymbol = getResources().getString(R.string.search_prefix_symbols);
		prefixNote =  getResources().getStringArray(R.array.search_prefix_explain);
		strChuThich = getResources().getString(R.string.search_prefix_note) + "\n";
		for (int i = 0; i < prefixSymbol.length(); i++) {
			strChuThich += "\n'" + (prefixSymbol.charAt(i) + "' : " + prefixNote[i] );		
		}
		tvSearch.setText(strChuThich);
		btnCheckUpdate.setOnClickListener(new OnClickListener() {
			public void onClick(View view) {
				SongUpdater updater = new SongUpdater(HelpActivity.this);
				updater.updateFromInternet();
			}
		});
	}	
}
